﻿using System;
using System.Collections.Generic;
using System.Linq;
using Rated.DAL.Db;
using Rated.Website.Exceptions;

namespace Rated.Website.Models
{
    public class RatedItemListViewModel
    {
        public List<RatedItem> Items { get; set; }

        public RatedItemListViewModel()
        {
          throw new EIncorrectConstructor();
        }

        public RatedItemListViewModel(int ownerId)
        {
            var db = new RatedEntities();
            Items = db.RatedItems.Where(o => o.OwnerID == ownerId).ToList();
        }

    }
}